<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数组去重</title>
</head>

<body>

</body>
<script>
    var arr = [1, 1, 2, 3, 4, 4, 2, 1, 3, 5, 6, 6];

    function norepeat(item) {
        for (let i = 0; i < item.length; i++) {
            for (let j = i + 1; j < item.length; j++) {
                if (item[i] == item[j]) {
                    item.splice(j, 1);
                    j--;
                }
            }
        }
        return item;
    }

    console.log(norepeat(arr))
</script>

</html>